const path = require('path')
const routes = [
    {
      path: '/',
      component: path.resolve(__dirname, '../pages/layout/'),
      children:[
        //首页
        {
          path: '',
          name: 'home',
          component: path.resolve(__dirname, '../pages/home/')
        },
        // 登录
        {
          path: '/login',
          name: 'login',
          component: path.resolve(__dirname, '../pages/login/')
        },
        // 注册
        {
          path: '/register',
          name: 'register',
          component: path.resolve(__dirname, '../pages/login/')
        },
        // 用户中心
        {
          path: '/profile/:username',
          name: 'profile',
          component: path.resolve(__dirname, '../pages/profile/')
        },
        // 设置
        {
          path: '/settings',
          name: 'settings',
          component: path.resolve(__dirname, '../pages/settings/')
        },
        // 文章编辑
        {
          path: '/editor/:slug',
          name: 'editor',
          component: path.resolve(__dirname, '../pages/editor/')
        },
        // 文章发布
        {
          path: '/create',
          name: 'create',
          component: path.resolve(__dirname, '../pages/editor/')
        },
        // 文章详情
        {
          path: '/article/:slug',
          name: 'article',
          component: path.resolve(__dirname, '../pages/article/')
        }
      ]
    }
]
export default routes